package com.ds.msg.mqtt.topic;

import com.ds.annotation.MethodChinaName;
import com.ds.config.ResultModel;
import com.ds.msg.mqtt.JMQException;
import com.ds.msg.mqtt.command.cmd.CreateTopicCommand;
import com.ds.msg.mqtt.command.cmd.SubscriptTopicCommand;
import com.ds.msg.mqtt.command.cmd.UnSubscriptTopicCommand;
import org.springframework.web.bind.annotation.ResponseBody;

public interface TopicService {
    /**
     * @param topic
     * @return
     * @throws JMQException
     */
    @MethodChinaName(cname = "订阅")
    @ResponseBody
    public ResultModel<SubscriptTopicCommand> subscriptTopic(String topic);


    /**
     * @param topic
     * @return
     * @throws JMQException
     */
    @MethodChinaName(cname = "取消订阅")
    @ResponseBody
    public ResultModel<UnSubscriptTopicCommand> unSubscriptTopic(String topic);


    /**
     * @param topic
     * @return
     * @throws JMQException
     */
    @MethodChinaName(cname = "创建")
    @ResponseBody
    public ResultModel<CreateTopicCommand> createTopic(String topic, Boolean retained, Integer qos);


}
